class MyClass:
    id = None
    name = None

    def __init__(self, **kwargs):
        if 'id' in kwargs:
            print 'id %d in kwargs' % kwargs['id'] 
            
        if 'name' in kwargs:
            print 'name %s in kwargs' % kwargs['name'] 

        for k,v in kwargs.items():
            setattr(self, k, v)

    def __repr__(self):
        print 'id %d, name %s' % (self.id, self.name)

instance = MyClass(id=2, name='abcd')
